#http://www.javaeye.com/topic/133010 do
#plugin 
#ruby script/plugin install http://www.redhillonrails.org/svn/trunk/vendor/plugins/redhillonrails_core
#ruby script/plugin install http://www.redhillonrails.org/svn/trunk/vendor/plugins/foreign_key_migrations

require 'migration_helpers'

class CreateItemZhs < ActiveRecord::Migration
  extend MigrationHelpers
  
  def self.up
    create_table :item_zhs do |t|
      t.column :catalog_zh_id, :integer, :null=>false , :references => :catalog_zhs
      t.column :name, :string , :limit => 200, :null=>false
      t.column :context, :text, :null=>false
      t.column :url, :string, :limit => 200
      t.column :req, :integer, :null=>false, :default=>50
      t.column :req_recommended, :integer, :default=>50
      t.column :recommended, :boolean, :default=>false
      t.column  :created_at, :timestamp
    end
    
    #foreign_key :item_zhs, :catalog_zh_id, :catalog_zh    
    
  end

  def self.down
     #drop_foreign_key :item_zhs, :catalog_zh_id
     drop_table :item_zhs
  
  end
end
